package com.unc.allergyex.objects;

/**This is used to pass messages between Updater and UpdateTask.  
 * It is just getters and setters, no processing of data.  
 * @author Stephanie
 *
 */
/**
 * @author zolayvar
 *
 */
/**
 * @author zolayvar
 *
 */
public class VersionResult {
	boolean allergensChanged;
	boolean restaurantsChanged;
	boolean error;
	String message;
	
	/**
	 * The default constructor for the class.  Initialize fields to default values;
	 */
	public VersionResult(){
		this.allergensChanged = false;
		this.restaurantsChanged = false;
		this.error = false;
		this.message = "";
	}
	
	/**A constructor used to initalize all the fields during construction.  
	 * @param allergensChanged whether the allergens version has changed
	 * @param restuarantsChanged whether the restaurants version has changed
	 * @param error whether an error was encountered during the update
	 * @param message any text message that should be posted to the user
	 */
	public VersionResult(boolean allergensChanged, boolean restuarantsChanged, boolean error, String message) {
		this.allergensChanged = allergensChanged;
		this.restaurantsChanged = restuarantsChanged;
		this.error = error;
		this.message = message;
	}

	/**getter for allergensChanged value
	 * @return allergensChanged
	 */
	public boolean isAllergensChanged() {
		return allergensChanged;
	}

	/**getter for restaurantsChanged value
	 * @return restaurantsChanged
	 */
	public boolean isRestaurantsChanged() {
		return restaurantsChanged;
	}

	
	/**setter for allergensChanged value
	 * @param allergensChanged the value to set allergensChanged to
	 */
	public void setAllergensChanged(boolean allergensChanged) {
		this.allergensChanged = allergensChanged;
	}

	/**the setter for restaurantsChanged value
	 * @param restaurantsChanged the value to set restaurantsChanged to
	 */
	public void setRestaurantsChanged(boolean restaurantsChanged) {
		this.restaurantsChanged = restaurantsChanged;
	}
	
	/**setter for the error boolean
	 * @param error the value to set error to
	 */
	public void setError(boolean error) {
		this.error = error;
	}

	/**setter for the message string
	 * @param message the string to set message to
	 */
	public void setMessage(String message) {
		this.message = message;
	}

	/**getter for the error boolean
	 * @return the error boolean
	 */
	public boolean isError() {
		return error;
	}

	/**getter for the message string
	 * @return the message string
	 */
	public String getMessage() {
		return message;
	}	
}
